package com.hyq.market.ui.home.model;

import com.hyq.market.api.AbsServiceUtils;
import com.hyq.market.api.BaseRequest;
import com.hyq.market.api.Constant;
import com.hyq.market.bean.Goods;

import org.xutils.http.RequestParams;

/**
 * Created by Administrator on 2017/7/19 0019.
 */

public class ModelGoods extends AbsServiceUtils {


    @Override
    public Goods fromJson(String json) {
       // sendCode=0x23;
        return  gson.fromJson(json, Goods.class);
    }

    @Override
    public <T> void getData(T t) {
        if (t instanceof BaseRequest){
            BaseRequest request= (BaseRequest) t;
            RequestParams params=new RequestParams(Constant.API_Index_getisrecommandGoods);
            params.addBodyParameter("p",request.getPageNo()+"");
            sendToServer(params,1);
        }

    }

    @Override
    public void getData() {
        RequestParams params=new RequestParams(Constant.API_Index_getisrecommandGoods);
        sendToServer(params);
    }

}
